use markdown_parser::parse;

#[test]
fn test_markdown_image() {
    let doc: &str = "a b c";
    let link = "http://#33";
    let input = format!("![{doc}]({link})\n");
    let (res, errs) = parse(&input);
    if let Some(errs) = &errs {
        println!("{}", errs)
    }
    if let Some(res) = res {
        // println!("{:#?}", res);
        assert_eq!(
            res.first().unwrap().to_string().trim(),
            format!("<p><img src=\"{link}\" alt=\"{doc}\"/></p>")
        );
    } else {
        panic!("图片解析错误");
    }
    assert!(errs.is_none())
}
